-module(fileupdate).
-export([start/4]).
-import(erlang, [display/1]).

start(Id, Neighbors, FragId, FloatList) ->
	random:seed(now()),
	io:format("~p Starting gossip loop for updating fragment ~p~n", [Id, FragId]),
	case gossipprob:getGossipNode(Neighbors) of
	  {ok, Node} ->
			io:format("Talking to node ~p~n", [Node]),
			Node ! {update, FragId, FloatList};
		{error, _Msg} ->
			io:format("Talking to myself~n")
	end,
	ok.